<!--本期产品组件-->
<template>
	<div class="livecurproduct-box" ref="livecurproductBox" v-html="htmlConnect">
	</div>
</template>

<script>
	export  default{
		data(){
			return{
				htmlConnect:''
			}
		},
    created: function() { 
    	this.$store.dispatch("isBoxTrue");
    },
    activated:function () {
  	 var TabArray;
  	      if(sessionStorage.getItem("liveNavtable")){
  	      	TabArray =JSON.parse(sessionStorage.getItem("liveNavtable"));
  	      }else{
  	      	TabArray = this.$store.state.liveNavTabArray
  	      }
			for (var i = 0  ;i<TabArray.length;i++) {
				if(TabArray[i].type == 3){
					this.$store.dispatch("setRoomTab", ++i)
				}
			}
   },
		mounted:function(){
			 this.getCurProductData();
		},
		methods:{
			getCurProductData(){
				let _this = this;
				_this.$http.get('/h5live/getTableContent?roomId='+this.$route.params.roomid).then((res) => {
					if(res.data.code=='000000'){
						let content = res.data.data.content;
						const regex = new RegExp('<img', 'gi')
                        content = content.replace(regex, `<img style="max-width: 100%; height: auto"`);
						_this.htmlConnect = content
					}
				}, (err) => {
					console.log(err);
				})
			}
		}
	}

</script>

<style scoped="scoped">
	.livecurproduct-box{
		width: 100%;
		height: calc(100vh - 600px);
		background: white;
	    position: absolute;
	    top: 600px;
	    left: 0;
	    overflow-y: scroll;
	    padding: 0 20px  0;
	}
</style>
